

function calTotalWine(){
	
	var ticket = document.getElementById("tickets").value;
	//ticket = ticket.isNaN;
	var price = 1200000;
	var sub = 0;
	var discount = 0;
	var total = 0;
	sub = ticket*price;
	discount = (sub*20)/100;
	total = sub-discount;
	document.getElementById("sub").value =  sub;
	document.getElementById("discount").value =  discount;
	document.getElementById("total").value =  total;

	return true;
}

jQuery.noConflict(); 
(function($) {	
	$(document).ready(function(){
	/*
		var docwidth = jQuery(window).width();
		if(docwidth > 1024){
			var borderMargin = (docwidth-1004)/2 - 117;
			jQuery('#wmc_social').css('right',borderMargin+'px');
		}*/
		var width1 = jQuery(window).width();
		
	//	if (width1 == 1263)
	//		$('body#page').css('margin-left','-80px');
		if(width1 < 1010)
			$('#wmc_social').css('display','none');
		else	
			$('.sharebar').sharebar({horizontal:'true',swidth:'110',minwidth:1000,position:'right',leftOffset:20,rightOffset:3});
		//$('.sharebar').sharebar({horizontal:'true',swidth:'75',minwidth:1000,position:'left',leftOffset:20,rightOffset:10});
	//	sharebar_init();	
	/*	var i = 1;
		jQuery("ul.slides").each(function(i){ 
			jQuery(this).find("li").addClass("list"+i);
			i++;
		});*/
		

		$(".wk-slideshow-listcloud ul.slides").children().each(function(i) {
		  $(this).addClass("list_" + (i+1));
		});
		jQuery("ul.slides").children().each(function(i){ 
			var a = ".list_" + (i+1);
		//	alert(i+1);
			$(a+' .wmc_readmore').click(function(){
				$(this).html('');
				$(a+' .wmc_hide').css('display','block');
				$(a+' .wmc_scroll').jScrollPane({ autoReinitialise: false });
			});
		});
		
		
	/*	$('input#tickets').live('change', function(){
            alert('aaa');
			return false;
		});
		$("#tickets").numeric();
		$("#package").numeric();*/
	});
}) (jQuery);

jQuery.fn.sharebar = function(options) {
	var defaults = {horizontal: true, swidth: 65, minwidth: 1000, position: 'left', leftOffset: 20, rightOffset: 10};
	var opts = jQuery.extend(defaults, options); var o = jQuery.meta ? jQuery.extend({}, opts, jQueryjQuery.data()) : opts;

	var w = jQuery(window).width();
	var sharebar = jQuery('#wmc_social');
	var sharebarx = jQuery('.sharebar');
	var parent = jQuery(sharebar).parent().width();
	var start = sharebar_init();

	function sharebar_init(){
		jQuery(sharebar).css('width',o.swidth+'px');
		if (o.position == 'left') jQuery(sharebar).css('marginLeft',(0-o.swidth-o.leftOffset));
		else {
			jQuery(sharebar).css('marginLeft',(parent+o.rightOffset));
		}
		if(w < o.minwidth && o.horizontal) jQuery(sharebarx).slideDown();
		else jQuery(sharebar).fadeIn();
		jQuery.event.add(window, "scroll", sharebar_scroll);
		jQuery.event.add(window, "resize", sharebar_resize);
		return jQuery(sharebar).offset().top;
	}
	function sharebar_resize() {
		var w = jQuery(window).width();
		if(w<o.minwidth){
			jQuery(sharebar).fadeOut();
			if(o.horizontal) jQuery(sharebarx).slideDown();
		}else{
			jQuery(sharebar).fadeIn();
			if(o.horizontal) jQuery(sharebarx).slideUp();
		}
	}
	function sharebar_scroll() {
		var p = jQuery(window).scrollTop();
		var w = jQuery(window).width();
		jQuery(sharebar).css('position',((p+10)>start) ? 'fixed' : 'absolute');
		jQuery(sharebar).css('top',((p+10)>start) ? '10px' : '');
	}

};